﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NetFrameworkExtensions.BusinessLayer
{
  [Serializable]
  public class FilterOperator : IFormatted
  {
    private string _caption;
    private FilterOperatorType _type;
    private int _operandCount;

    public FilterOperator(FilterOperatorType type, int operandCount, string caption = null)
    {
      _type = type;
      _operandCount = operandCount;
      _caption = caption ?? type.ToString();
    }

    public string Caption
    {
      get { return _caption; }
    }

    public FilterOperatorType Type
    {
      get { return _type; }
    }

    public int OperandCount
    {
      get { return _operandCount; }
    }

    public override string ToString()
    {
      return _type.ToString();
    }

    public string Formatted
    {
      get
      {
        return Caption;
      }
    }
  }
}
